package com.alan.mr.weibo;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * Created by Alan on 2017/10/2.
 */
public class ThirdReducer extends Reducer<Text,Text,Text,Text>{

    @Override
    protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        StringBuffer sb = new StringBuffer();
        for (Text text : values) {
            sb.append(text.toString() + "\t");
        }
        context.write(key, new Text(sb.toString()));
    }

}
